package scheduledtasks.parscorn;



import scheduledtasks.entity.TaskObj;

import java.util.Date;


/**
 * 【是否是工作日]
 *
 * @author tiny
 * @version 1.0
 * @company bc
 * @copyright (c) 2022 bcInc. All rights reserved.
 * @date 2022-11-08 16:00:26
 * @since
 */

public class WorkParse extends ParseAbstract {

    @Override
    public boolean pars(String cron, TaskObj obj) {
        String cronstr=ParsUntil.getcron(cron,6);
        if(cronstr.equals("w")){
            if(Wenk()){
                return getParseAbstract().pars(cron,obj);
            }
        }else {
            return getParseAbstract().pars(cron,obj);
        }
        return false;
    }


    public boolean Wenk(){
        Date date=new Date();
        String week= ParsUntil.getWeekOfDate(date);
        if(week.equals("6") || week.equals("7")){
            return false;
        }
        return false;
    }


}
